package com.lanchetech.dao;

import com.lanchetech.entity.UserTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserTaskMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UserTask record);

    int insertSelective(UserTask record);

    UserTask selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserTask record);

    int updateByPrimaryKey(UserTask record);

    List<UserTask> findAllByUserIdAndKindAndTaskTimeAndStatus(@Param("userId")Long userId,@Param("kind")Long kind,@Param("taskTime")Date taskTime,@Param("status")Byte status);

    UserTask findOneByUserIdAndTaskId(@Param("userId") Long userId, @Param("taskId") Long taskId);

    List<UserTask> findAllByIdsAndUserId(@Param("ids") List<Long> ids, @Param("userId") Long userId, @Param("date") Date date);

    List<UserTask> findAllByUserIdAndTaskIdAndTaskTime(@Param("userId") Long userId, @Param("taskId") Long taskId, @Param("taskTime") Date taskTime);

    int getCompleteNumber(@Param("userId") Long id, @Param("taskId") Long taskId, @Param("stauts") Byte stauts);
}